package com.ruoyi.city.service.impl;

import java.util.List;
import com.ruoyi.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.city.mapper.HouseSourceMapper;
import com.ruoyi.city.domain.HouseSource;
import com.ruoyi.city.service.IHouseSourceService;

/**
 * 房源详情Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-09-19
 */
@Service
public class HouseSourceServiceImpl implements IHouseSourceService 
{
    @Autowired
    private HouseSourceMapper houseSourceMapper;

    /**
     * 查询房源详情
     * 
     * @param sourceId 房源详情主键
     * @return 房源详情
     */
    @Override
    public HouseSource selectHouseSourceBySourceId(Long sourceId)
    {
        return houseSourceMapper.selectHouseSourceBySourceId(sourceId);
    }

    /**
     * 查询房源详情列表
     * 
     * @param houseSource 房源详情
     * @return 房源详情
     */
    @Override
    public List<HouseSource> selectHouseSourceList(HouseSource houseSource)
    {
        return houseSourceMapper.selectHouseSourceList(houseSource);
    }

    /**
     * 新增房源详情
     * 
     * @param houseSource 房源详情
     * @return 结果
     */
    @Override
    public int insertHouseSource(HouseSource houseSource)
    {
        return houseSourceMapper.insertHouseSource(houseSource);
    }

    /**
     * 修改房源详情
     * 
     * @param houseSource 房源详情
     * @return 结果
     */
    @Override
    public int updateHouseSource(HouseSource houseSource)
    {
        houseSource.setUpdateTime(DateUtils.getNowDate());
        return houseSourceMapper.updateHouseSource(houseSource);
    }

    /**
     * 批量删除房源详情
     * 
     * @param sourceIds 需要删除的房源详情主键
     * @return 结果
     */
    @Override
    public int deleteHouseSourceBySourceIds(Long[] sourceIds)
    {
        return houseSourceMapper.deleteHouseSourceBySourceIds(sourceIds);
    }

    /**
     * 删除房源详情信息
     * 
     * @param sourceId 房源详情主键
     * @return 结果
     */
    @Override
    public int deleteHouseSourceBySourceId(Long sourceId)
    {
        return houseSourceMapper.deleteHouseSourceBySourceId(sourceId);
    }
}
